package com.lql.common.enums;

/**
 * @author huangding
 * @description
 * @date 2018/12/10 13:18
 */
public enum RoleEnum {
    /**
     * 角色 1:普通 2:折扣 3:包年包月
     */
    ORDINARY(1, "普通用户"),
    DISCOUNT(2, "折扣用户"),
    ANNUALLY(3, "包年/月用户"),
    ;

    private Integer type;
    private String val;

    RoleEnum(Integer type, String val) {
        this.type = type;
        this.val = val;
    }

    public static RoleEnum getRoleEnum(Integer type) {
        if (null == type) {
            return null;
        }
        for (RoleEnum v : values()) {
            if (v.getType().equals(type)) {
                return v;
            }

        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public String getVal() {
        return val;
    }
}
